<template>
  <div class="vx-bank-card">
    <div class="vx-bank-card-title">
      <slot></slot>
    </div>
    <div class="vx-bank-card-content" :style="{ backgroundColor: $msg('bankCardBgcolorDict')[bgSrc] || '#5D6BD4' }">
      <div class="bank-card">
        <div class="card-body">
          <img :src="require('@/assets/image/bankLogo/' + bgSrc + '.png')" alt />
          <div>
            <div class="account-name">{{ accountName }}</div>
            <div class="account-no">{{ accountNo | formatStringFilter }}</div>
          </div>
        </div>
        <div class="bank-name text-nowrap">
          <ui-tooltip class="item" effect="dark" :content="bankName" placement="top-start">
            <span>{{ bankName }}</span>
          </ui-tooltip>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'vx-bank-card',
  props: {
    bgSrc: {
      type: String,
      default: '',
    },
    accountName: {
      type: String,
      default: '',
    },
    accountNo: {
      type: String,
      default: '',
    },
    bankName: {
      type: String,
      default: '',
    },
  },
};
</script>

<style lang="scss">
.vx-bank-card {
  .vx-bank-card-title {
    text-align: center;
    font-size: 18px;
    color: #3b4c87;
    margin-bottom: 15px;
  }

  .vx-bank-card-content {
    width: 280px;
    border: 1px solid #d1d1d1;
    padding: 20px 15px;
    border-radius: 10px;
    box-sizing: border-box;

    .bank-card {
      margin-left: 5px;
      color: #f7ebed;
      font-size: 14px;
      .card-body {
        display: flex;
        align-items: center;
      }
      img {
        float: left;
        margin-right: 8px;
        width: 40px;
        height: 40px;
      }
      .account-name {
        padding-top: 3px;
      }
      .account-no {
        margin-left: 1px;
        margin-top: 5px;
      }
      .bank-name {
        margin-top: 17px;
        font-size: 12px;
      }
    }
  }
}
</style>
